//package com.loopy.fruns.web;
//
//import com.loopy.fruns.entity.Member;
//import com.loopy.fruns.service.MemberService;
//import com.loopy.fruns.service.impl.MemberServiceImpl;
//
//import javax.servlet.*;
//import javax.servlet.http.*;
//import java.io.IOException;
//
//public class RegisterServlet extends HttpServlet {
//    private MemberService memberService=new MemberServiceImpl();
//    @Override
//    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        doPost(request, response);
//    }
//
//    @Override
//    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        System.out.println("RegisterServlet被调用");
//        String username = request.getParameter("user-name");
//        if(!memberService.isExitsUserName(username)){
////            System.out.println("用户名"+username+"不存在，可用");
//            String userpassword = request.getParameter("user-password");
//            String useremail = request.getParameter("user-email");
//            Member member = new Member(null, username, userpassword, useremail);
//            if(memberService.registerMember(member)) {
////                System.out.println("注册成功");
//                request.getRequestDispatcher("/views/member/register_ok.jsp").forward(request,response);
//
//            }else {
////                System.out.println("注册失败");
//                request.getRequestDispatcher("/views/member/register_fail.jsp").forward(request,response);
//            }
//
//        }else {
//            request.getRequestDispatcher("/views/member/login.jsp").forward(request,response);
//        }
//
//
//
//
//
//    }
//}
